/* 基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  width: 360px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-x: hidden;
}

/* 头部样式 */
header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  background-color: #4285f4;
  color: white;
  position: relative;
}

header h1 {
  font-size: 18px;
  margin-bottom: 10px;
  text-align: center;
}

.tab-container {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.tab {
  padding: 6px 16px;
  border: none;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tab:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.tab.active {
  background-color: white;
  color: #4285f4;
  font-weight: 500;
}

/* 主要内容区域 */
main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 表单元素 */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

textarea, input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
}

/* 按钮样式 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.rounded-btn {
  border-radius: 24px;
}

.primary {
  background-color: #1a73e8;
  color: white;
}

.primary:hover {
  background-color: #1765cc;
  box-shadow: 0 1px 3px rgba(26,115,232,0.4);
}

.success {
  background-color: #34a853;
  color: white;
}

.success:hover {
  background-color: #2e8b47;
}

.secondary {
  background-color: #f1f3f4;
  color: #4285f4;
}

.secondary:hover {
  background-color: #e8eaed;
}

.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 搜索页面 */
.search-container {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-container input {
  flex: 1;
  border: 1px solid #dadce0;
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 14px;
  height: 40px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.1);
  transition: all 0.2s;
}

.search-container input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 1px 4px rgba(26,115,232,0.2);
}

.search-container button {
  border-radius: 24px;
  min-width: 80px;
  height: 40px;
  font-weight: 500;
}

/* 搜索结果样式 */
.search-results {
  margin-top: 20px;
}

/* 标签筛选区域标题 */
.filter-title {
  font-size: 12px;
  color: #5f6368;
  margin: 4px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background-color: #f8f9fa;
  overflow: visible;
  max-width: 100%;
  padding: 6px 8px;
  margin-bottom: 10px;
}

.tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f7fa;
  color: #666;
  border-radius: 12px;
  padding: 0 8px;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  height: 20px;
  border: 1px solid #e8eaed;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin: 1px;
}

.tag.search-tag {
  background-color: #f5f7fa;
  color: #5f6368;
  font-weight: 500;
  min-width: fit-content;
  font-size: 10px;
}

.tag.search-tag:hover {
  background-color: #e8f0fe;
  color: #1a73e8;
  border-color: #d2e3fc;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(26,115,232,0.2);
}

.tag.search-tag:active {
  transform: translateY(0);
}

.tag.active {
  background-color: #1a73e8;
  color: white;
  border-color: #1a73e8;
  box-shadow: 0 1px 3px rgba(26,115,232,0.4);
}

/* 添加标签栏隐藏/显示按钮 */
.toggle-tags-btn {
  background: none;
  border: none;
  color: #5f6368;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.toggle-tags-btn:hover {
  color: #1a73e8;
}

.toggle-tags-btn:focus {
  outline: none;
}

/* 隐藏标签栏时的样式 */
.filter-container.hidden {
  display: none;
}

/* 标签删除按钮 */
.tag-delete {
  display: inline-block;
  margin-left: 4px;
  font-weight: bold;
  cursor: pointer;
}

.tag-delete:hover {
  color: #f44336;
}

/* 标签操作按钮 */
.tag-actions {
  display: inline-block;
  margin-left: 8px;
}

.btn.mini {
  font-size: 12px;
  padding: 2px 6px;
  margin: 2px;
  max-width: fit-content;
}

.btn.danger {
  background-color: #f44336;
  color: white;
}

.btn.danger:hover {
  background-color: #d32f2f;
}

/* 标签添加对话框 */
.tag-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 250px;
}

.tag-dialog input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 提示词显示 */
.prompt-item {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  margin-bottom: 12px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(60,64,67,0.1);
  transition: all 0.2s;
  position: relative;
}

.prompt-item:hover {
  box-shadow: 0 1px 6px rgba(60,64,67,0.2);
}

.prompt-title {
  font-weight: 500;
  margin-bottom: 8px;
  color: #202124;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.prompt-content {
  margin-bottom: 10px;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.prompt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  overflow: hidden;
}

.prompt-tags .tag {
  font-size: 9px;
  height: 18px;
  padding: 0 5px;
  background-color: #f1f3f4;
  color: #5f6368;
  border-color: transparent;
  box-shadow: none;
}

.prompt-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.similarity-score {
  font-size: 12px;
  color: #5f6368;
  margin-top: 6px;
  text-align: right;
  font-weight: 500;
}

/* 无结果提示 */
.no-results, .no-prompts, .no-tags {
  text-align: center;
  padding: 16px;
  color: #5f6368;
  font-size: 14px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-top: 16px;
}

/* 状态栏 */
footer {
  padding: 8px 16px;
  border-top: 1px solid #e5e5e5;
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status {
  text-align: center;
}

/* API状态指示器 */
.api-status {
  display: flex;
  align-items: center;
}

#api-platform-indicator {
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

#api-platform-indicator.aliyun {
  background-color: #e6f4ea;
  color: #137333;
}

/* 硅基流平台指示器 */
#api-platform-indicator.guiji {
  background-color: #e8f0fe;
  color: #1a73e8;
}

#api-platform-indicator.not-configured {
  background-color: #fce8e6;
  color: #c5221f;
}

#api-platform-indicator.openai {
  background-color: #f0f0f0;
  color: #10a37f;
}

/* 管理页面 */
.manage-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.prompt-detail {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 80%;
  max-height: 80%;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* 设置图标样式 */
.settings-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.settings-icon:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.settings-icon svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* API文档样式 */
.api-docs {
  margin-top: 24px;
  padding: 16px;
  background-color: #f9f9f9;
  border-radius: 4px;
  font-size: 12px;
}

.api-docs h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  color: #4285f4;
}

.api-docs ul {
  padding-left: 16px;
}

.api-docs li {
  margin-bottom: 6px;
}

/* 编辑提示词对话框 */
.edit-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 80%;
  max-width: 500px;
}

.edit-dialog h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #333;
}

.edit-dialog textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
}

.edit-dialog .dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 详情模态框中的复制按钮 */
.modal .btn {
  margin-top: 12px;
}

/* 相似提示词对话框 */
.similar-prompts-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.similar-prompts-dialog h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.similar-prompts-dialog p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.similar-prompts-list {
  background-color: #f9f9f9;
  border-radius: 4px;
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.similar-prompt-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.similar-prompt-item:last-child {
  border-bottom: none;
}

.similar-prompt-item:hover {
  background-color: #f0f0f0;
}

.similar-prompt-title {
  font-weight: 500;
  flex: 1;
}

.similar-prompt-similarity {
  color: #4285f4;
  font-size: 12px;
  margin-left: 8px;
}

/* 详情对话框内的标签 */
.dialog-tags {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

/* 提示词全文内容 */
.prompt-full-content {
  white-space: pre-wrap;
  background-color: #f9f9f9;
  padding: 12px;
  border-radius: 4px;
  margin: 12px 0;
  max-height: 300px;
  overflow-y: auto;
}

/* 重新计算向量对话框 */
.recalculating-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 20px;
  z-index: 2000;
  width: 80%;
  max-width: 400px;
  text-align: center;
}

.recalculating-dialog h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #333;
}

#recalculating-progress-text {
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #4285f4;
  transition: width 0.3s ease;
}

/* 标签提示样式 */
.tag-tooltip {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.tags-wrapper:hover .tag-tooltip {
  opacity: 1;
}

/* 修复搜索结果区域，防止横向滚动 */
.results-container {
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0;
}

/* 禁止页面横向滚动 */
html, body {
  overflow-x: hidden;
  width: 100%;
} 